{# Display a form to create a new ticket #}

{% extends "ticket/base.html" %}

{% import "forms.html" as forms %}
{% import "ticket/ticket_macros.html" as ticket_macros with context %}

{% block title_text %}
    {{ _("Create new ticket") }}
{% endblock %}

{% block ticket_content %}
    <h2>{{ _("Summary") }}</h2>
    <div class="moin-ticket-layout">
        {{ forms.render(form['meta']['summary']) }}
    </div>
    <div style="clear:both;"></div>
    <div id="finalresults">
        {% include "ajaxsearch.html" %}
    </div>
    <div style="clear:both;"></div>

    <h2>{{ _("Describe the ticket") }}</h2>
    <div class="moin-ticket-layout">
        <div class="form-group">
            {{ gen.label(form['message']) }}
            {{ gen.textarea(form['message'], class='form-control') }}
        </div>
    </div>
    <div style="clear:both;"></div>

    <h2>{{ _("Metadata") }}</h2>
        <div class="moin-ticket-layout">
            <dl>
                {{ forms.render_errors(form) }}
                {{ ticket_macros.render_meta() }}
            </dl>
            <div class="moin-ticket-tags">
                {{ _("Suggested Tags: ") }}
                {% for suggested_tag in suggested_tags | sort %}
                    <a href="#">{{ suggested_tag }}</a>
                {% endfor %}
            </div>
        </div>
        <div class="moin-ticket-layout">
            <dl>
                {{ ticket_macros.render_selectlists() }}
            </dl>
        </div>
        <div class="moin-ticket-layout">
            <dl>
                <dt>
                    {{ gen.label(form['data_file']) }}
                </dt>
                <dd>
                    {{ gen.input(form['data_file'], type='file') }}
                </dd>
            </dl>
        </div>
        <div class="moin-ticket-submit">
            {{ forms.render_submit(form) }}
        </div>
    <div style="clear:both;"></div>

{% endblock %}
